/***********************************************************************
 * 描述:		文件查询结果类
 * File:    queryresult.h
 * Author:  liquan@mozihealthcare.cn
 * Date:    2025-10-13
 * Update:
 **********************************************************************/

#ifndef QUERYRESULT_H
#define QUERYRESULT_H

#include <common/serialization.h>
#include "fileinfo.h"

struct QueryResult
{
	/**
	 * true成功/false失败
	 */
	bool success;
	/**
	 * 结果标识
	 */
	QString code;
	/**
	 * 结果描述
	 */
	QString msg;
	/**
	 * 结果数据
	 */
	FileInfo data;
};

RAPIDJSON_ADAPT_STRUCT(QueryResult,
					   "success", &QueryResult::success,
					   "code", &QueryResult::code,
					   "msg", &QueryResult::msg,
					   "data", &QueryResult::data)

BEGIN_DESERIALIZE_ADAPTER(QueryResult)
DESERIALIZE_FIELD(success)
DESERIALIZE_FIELD(code)
DESERIALIZE_FIELD(msg)
DESERIALIZE_FIELD(data)
END_DESERIALIZE_ADAPTER()

#endif //QUERYRESULT_H
